﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 招聘网站
{
    public partial class Form12 : Form
    {
        public static string z;
        public static string x;
        public Form12()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {
         
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void Form12_Load(object sender, EventArgs e)
        {
            label1.Text = Form10.c + "的简历";

           /* string sqlStr = "server=.;database=zhaopin;integrated security=SSPI";
            SqlConnection con = new SqlConnection(sqlStr);
            con.Open();
            SqlCommand com = new SqlCommand("selectsql", con);
            com.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter sdr = new SqlDataAdapter("select like 'c' from table_4 and table_3", con);
            DataSet dt = new DataSet();
            sdr.Fill(dt);
            this.dataGridView1.DataSource = dt.Tables[0].DefaultView;*/

            string sqlStr = "server=.;database=zhaopin;integrated security=SSPI";
            SqlConnection con = new SqlConnection(sqlStr);
            con.Open();
            string selectsql = string.Format("Select * from table_2 where name='"+Form10 .c +"' ", con);
            SqlCommand com = new SqlCommand(selectsql, con);
            com.CommandType = CommandType.Text;
            SqlDataReader sdr;
            sdr = com.ExecuteReader();
            while (sdr.Read())
            {
                z = sdr["xuewei"].ToString().Trim();
                x = sdr["cszhiye"].ToString().Trim();
            }
            sdr.Close();
            con.Close();

            string SqlStr = "server=.;database=zhaopin;integrated security=SSPI";
            SqlConnection conn = new SqlConnection(SqlStr);
            conn.Open();
            SqlDataAdapter sqlda = new SqlDataAdapter("select * from table_3 where xuewei='" + z + "' and cszhiye='" + x + "'", conn);
            DataSet myds = new DataSet();
            sqlda.Fill(myds, "table_3");
            dataGridView1.DataSource = myds.Tables["table_3"];
            conn.Close();
        }
    }
}
